<?php

namespace app\services\system;

use app\dao\system\ApplicationDao;
use app\dao\system\AppRoutingDao;
use app\services\BaseServices;

/**
 * app应用模块
 */
class ApplicationServices extends BaseServices
{
    public function __construct(ApplicationDao $dao)
    {
        $this->dao = $dao;
    }

    public function pageList(array $where)
    {
        [ $page, $limit ] = $this->getPageValue();
        $query = $this->dao->search($where);
        $count = $query->count();
        $dataList = $query->order('sort desc')->page($page, $limit)->select()->toArray();

        return compact('dataList', 'count');
    }
}